
package br.unicamp.ic.lsd;

import javax.jws.WebService;

import br.unicamp.ic.lsd.exceptions.MethodOneWSOneException;
import br.unicamp.ic.lsd.exceptions.MethodOneWSOneExceptionB;
import br.unicamp.ic.lsd.exceptions.MethodThreeWSOneException;
import br.unicamp.ic.lsd.exceptions.MethodThreeWSOneExceptionB;
import br.unicamp.ic.lsd.exceptions.MethodTwoWSOneException;

@WebService(endpointInterface = "br.unicamp.ic.lsd.HelloWorld", serviceName="webserviceOne")
public class HelloWorldImpl implements HelloWorld{

    /* (non-Javadoc)
	 * @see br.unicamp.ic.lsd.HelloWorld#methodOneWSOne(int)
	 */
    public String methodOneWSOne(int k) throws MethodOneWSOneException, MethodOneWSOneExceptionB{
        switch(k){
        	case 0: return "methodOneWSOne executado com sucesso";
        	case 1: throw new MethodOneWSOneException("Falha do metodo methodOneWSOne Exception 1");	
        	case 2: throw new MethodOneWSOneExceptionB("Falha do metodo methodOneWSOne Exception 2");
        		
        }
        return "Algum erro ocorreu no metodo methodOneWSOne";
    }
    
    /* (non-Javadoc)
	 * @see br.unicamp.ic.lsd.HelloWorld#methodTwoWSOne(int)
	 */
    public String methodTwoWSOne(int k) throws MethodTwoWSOneException{
        switch(k){
        	case 0: return "methodTwoWSOne executado com sucesso";
        	case 1: throw new MethodTwoWSOneException("Falha do metodo methodTwoWSOne");		
        }
        return "Algum erro ocorreu no metodo methodTwoWSOne";
    }
    
    /* (non-Javadoc)
	 * @see br.unicamp.ic.lsd.HelloWorld#methodThreeWSOne(int)
	 */
    public String methodThreeWSOne(int k) throws MethodThreeWSOneException, MethodThreeWSOneExceptionB{
        switch(k){
        	case 0: return "methodThreeWSOne executado com sucesso";
        	case 1: throw new MethodThreeWSOneException("Falha do metodo methodThreeWSOne Exc 1");	
        	case 2: throw new MethodThreeWSOneExceptionB("Falha do metodo methodThreeWSOne Exc 2");	
        }
        return "Algum erro ocorreu no metodo methodThreeWSOne";
    }
}

